package restlet;

import org.restlet.Restlet;
import org.restlet.Server;
import org.restlet.data.Form;
import org.restlet.data.MediaType;
import org.restlet.data.Protocol;
import org.restlet.Request;
import org.restlet.Response;

public class Application {
	public static void main(String[] args) throws Exception {
		Restlet_User user = new Restlet_User();
		Server server = new Server(Protocol.HTTP, 8182, user);
		server.start();
	}
}

class Restlet_User extends Restlet {
	@Override
	public void handle(Request request, Response response) {
		Form form = new Form(request.getEntity());
		String name = form.getFirstValue("name");
		String number = form.getFirstValue("number");
		response.setEntity("Restlet - \nName : " + name + ", Number : " + number, MediaType.TEXT_PLAIN);
	}
}
